# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=apk-tools-d
pkgver=2.10.5.8
pkgrel=0
pkgdesc="D bindings for APK, the Alpine Package Keeper"
url="https://gitlab.alpinelinux.org/Cogitri/apk-toolsd/"
arch="x86 x86_64 aarch64" # ldc
license="GPL-2.0-or-later"
makedepends="meson ldc ldc-runtime openssl-d-dev"
subpackages="$pkgname-dev $pkgname-dbg"
source="https://gitlab.alpinelinux.org/Cogitri/apk-toolsd/-/archive/v$pkgver/apk-toolsd-v$pkgver.tar.gz"
builddir="$srcdir/apk-toolsd-v$pkgver"

build() {
	meson \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--buildtype=plain \
		. output
	ninja -C output
}

check() {
	ninja -C output test
}

package() {
	DESTDIR="$pkgdir" ninja -C output install
}

sha512sums="8cf69b7c1e2e0c0a59599e01243d204eef022a10a1363bef96206a31a7666c3acf92590e8fc9a54eec1344a9cceb9d329a38606ec6b0b397909e9dbf59091930  apk-toolsd-v2.10.5.8.tar.gz"
